home *** CD-ROM | disk | FTP | other *** search
- import java.applet.Applet;
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Font;
- import java.awt.Graphics;
-
- public class Glower extends Applet implements Runnable {
- // $FF: renamed from: f java.awt.Font
- Font field_0;
- Color[] colors = new Color[50];
- Thread runThread;
- String Text;
- String FontFace;
- int Size;
-
- public void start() {
- if (this.runThread == null) {
- this.runThread = new Thread(this);
- this.runThread.start();
- }
-
- }
-
- public void stop() {
- if (this.runThread != null) {
- this.runThread.stop();
- this.runThread = null;
- }
-
- }
-
- public void init() {
- if (((Applet)this).getParameter("Size") == null) {
- this.Size = 26;
- } else {
- this.Size = Integer.parseInt(((Applet)this).getParameter("Size"));
- }
-
- this.Text = ((Applet)this).getParameter("Text");
- this.Text = this.Text == null ? "Glower 1.2 (supplied with Lorenz Graf's HTMLtool)" : this.Text;
- this.FontFace = ((Applet)this).getParameter("FontFace");
- this.FontFace = this.FontFace == null ? "TimesRoman" : this.FontFace;
- this.field_0 = new Font(this.FontFace, 1, this.Size);
- float c = 0.0F;
-
- for(int i = 0; i < this.colors.length; ++i) {
- this.colors[i] = Color.getHSBColor(c, 1.0F, 1.0F);
- c = (float)((double)c + 0.02);
- }
-
- }
-
- public void run() {
- int i = 0;
-
- while(true) {
- ((Component)this).setForeground(this.colors[i]);
- ((Component)this).repaint();
- ++i;
-
- try {
- Thread.currentThread();
- Thread.sleep(50L);
- } catch (InterruptedException var2) {
- }
-
- if (i == this.colors.length - 1) {
- i = 0;
- }
- }
- }
-
- public void update(Graphics g) {
- this.paint(g);
- }
-
- public void paint(Graphics g) {
- g.setFont(this.field_0);
- g.drawString(this.Text, 15, 20);
- }
-
- public String getAppletInfo() {
- return "Glower v1.2 copyright 1997 by Lorenz Graf";
- }
- }
-